Project 1 - Computer Vision

Kacper Trębacz 145453

Jan Gruszczyński 145464

We have picked the problem concering removal of people from images of cathedral.

Name of the problem: "Creating a clean plate"

Our first naive approaches:

Mean filter

Median filter

Picking pixels that are the closest to the mean of pixels (respecitvely for each group of 5s images)

Detecting edges

Improved probalistic approach:

Picking the most common pixels, but allowing for certain error.

Avoiding certain colors:

Trying the same, but using change in HOG values.

Inspiration: https://towardsdatascience.com/hog-histogram-of-oriented-gradients-67ecd887675f

Using CV2 seamlessClone function

Inspiration: https://learnopencv.com/seamless-cloning-using-opencv-python-cpp/

Detecting humans with Grabcut algorithm

Inspiration: https://www.pyimagesearch.com/2020/07/27/opencv-grabcut-foreground-segmentation-and-extraction/

Using obtained solution for the most common pixel method.

This seems as the best result that we have obtained so far. wohooo! improvment!!!

Final solution

10 hours later... It was a long jurney to get here : D

We will try describe this solution more, as this is the final perfectly working one.

Inspiration: https://www.py4u.net/discuss/14401 (Inspiration only concers finding the differences between images, not the frame method presented below!)

The magic frame method

This algorithm detects empty spaces (black boxes) on our images, then it finds their frames (of size equal to padding). Then it searches those frames on other images, and finds the most similiar frame. From the image that has the most similiar frame, it copies it content to our black box. (Firstly the boxes are divided into smaller boxes, to improve the precission.

Now we just have to get rid of this small black part, unfortunately, the user has to mark it.

Testing different dataset (We weren't able to find non-trivial datasets available for free)

Unfortunately we weren't able (despite spending a lot of time for them) to find non-trivial datasets as hard as the one seen above avaiable for free.

Usually the simple method with detecting difference sufficed to remove any people from images.

Thank you for reading.